package com.springmvc.controller;


import com.springmvc.annotation.Controller;
import com.springmvc.annotation.Qualifier;
import com.springmvc.annotation.RequestMapping;
import com.springmvc.service.MyService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller("/hongchang")
public class MyController {

    @Qualifier("myService")
    MyService myService;

    @RequestMapping("/insert")
    public String insert(HttpServletRequest request, HttpServletResponse response, String param) {
        myService.insert(null);
        return "insert success!";
    }

    @RequestMapping("/delete")
    public String delete(HttpServletRequest request, HttpServletResponse response, String param) {
        myService.delete(null);
        return "delete success!";
    }

    @RequestMapping("/update")
    public String update(HttpServletRequest request, HttpServletResponse response, String param) {
        myService.update(null);
        return "update success!";
    }

    @RequestMapping("/select")
    public String select(HttpServletRequest request, HttpServletResponse response, String param) {
        myService.select(null);
        return "select success!";
    }
}
